﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using TotalSystems.Web.Services.Store;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using TotalSystems.DataAccess;
using TotalSystems.Store.Views.BaseInfo;
using System.ServiceModel.DomainServices.Client;
using GalaSoft.MvvmLight;
using TotalSystems.Core.Infrastructure;

namespace TotalSystems.TypeStore.ViewModels.BaseInfo
{
    public class TypeStore_VM : ViewModelBase
    {
        TypeStoreContext _Context = new TypeStoreContext();
        #region Constractor

        public TypeStore_VM()
        {
            _Context.Load(_Context.GetTypeStoreQuery(), OnGetTypeStoreQueryCompleted, null);
        }

        #endregion 

        //BaseDefenitionTreeViewBuilder<STR_TypeStore> TreeViewBuilder = new BaseDefenitionTreeViewBuilder<STR_TypeStore>();

        #region Defenition



        #endregion

        #region Propertis

        private ObservableCollection<STR_TypeStore> _TypeStoreEntitys;
        public ObservableCollection<STR_TypeStore> TypeStoreEntitys
        {
            get { return _TypeStoreEntitys; }
            set
            {
                _TypeStoreEntitys = value;
                RaisePropertyChanged("TypeStoreEntitys");
            }
        }

        #endregion

        #region 

        private void  OnGetTypeStoreQueryCompleted(LoadOperation<STR_TypeStore> op)
        {
            TypeStoreEntitys = new ObservableCollection<STR_TypeStore>(_Context.STR_TypeStores);
        }

        #endregion
    }
}
